CC = g++

CFLAGS = -wall -g

TARGET = program

SRC = $(wildcard *.cpp)

HDR = $(wildcard *.cpp)

OBJ = $(SRC:.cpp=.o)

all:$(TARGET)

$(TARGET):$(OBJ)
	$(CC) $(OBJ) -o $@

%.o:%.cpp %(HDR)
	$(CC) $(CFLAGS) -c $< -o $@

-include $(OBJ:.o=.h)